cmake_minimum_required(VERSION 3.16)
project(yolov5-dnn-cpp-python-v2)

link_libraries(asan)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer ")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=address  -lasan -lstdc++ ")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address  -lasan -lstdc++ ")

set(CMAKE_CXX_STANDARD 14)

add_executable(yolov5-dnn-cpp-python-v2 yolo.cc main.cc)
find_package(OpenCV REQUIRED)
target_link_libraries(yolov5-dnn-cpp-python-v2 ${OpenCV_LIBS})